Class: GOBL::Bill::Order

Inherits:
Object show all
Defined in:
lib/generated/gobl/bill/order.rb

Overview

Order documents are used for the initial part of a order-to-invoice process where the buyer requests goods or services from the seller.

Constant Summary collapse

SCHEMA_ID =

The Schema ID of the GOBL Order structure

'https://gobl.org/draft-0/bill/order'
TYPE_ENUM =

Enumeration of possible values for #type with their corresponding descriptions

{
  'purchase' => 'A purchase order is a document that a buyer sends to a seller to request goods or services.',
  'sale' => 'A sales order is a document that a seller sends to a buyer to confirm the sale of goods or services.',
  'quote' => 'A quote is a document that a seller sends to a buyer to provide a price for goods or services.'
}.freeze

Instance Attribute Summary collapse

Method Summary

Methods inherited from Object

new

Methods inherited from Struct

#as_json, from_data, from_json!, #to_json

Instance Attribute Details

#$addons($addons) ⇒ Array<GOBL::CBC::Key> (readonly)

Addons defines a list of keys used to identify tax addons that apply special normalization, scenarios, and validation rules to a document.

Returns:



49
# File 'lib/generated/gobl/bill/order.rb', line 49

property :$addons, [GOBL::CBC::Key]

#$regime($regime) ⇒ GOBL::L10n::TaxCountryCode (readonly)



43
# File 'lib/generated/gobl/bill/order.rb', line 43

property :$regime, GOBL::L10n::TaxCountryCode

#$tags($tags) ⇒ Array<GOBL::CBC::Key> (readonly)

Tags are used to help identify specific tax scenarios or requirements that may apply changes to the contents of the document or imply a specific meaning. Converters may use tags to help identify specific situations that do not have a specific extension, for example; self-billed or partial invoices may be identified by their respective tags.

Returns:



54
# File 'lib/generated/gobl/bill/order.rb', line 54

property :$tags, [GOBL::CBC::Key]

#attachmentsArray<GOBL::Org::Attachment> (readonly)

Attachments provide additional information or supporting documents that are not included in the main document. It is important that attachments are not used for alternative versions of the PDF, for that, see “links” inside the envelope headers.

Returns:



208
# File 'lib/generated/gobl/bill/order.rb', line 208

property :attachments, [GOBL::Org::Attachment]

#buyerGOBL::Org::Party (readonly)

Party who is responsible for issuing payment, if not the same as the customer.

Returns:



153
# File 'lib/generated/gobl/bill/order.rb', line 153

property :buyer, GOBL::Org::Party

#chargesArray<GOBL::Bill::Charge> (readonly)

Charges or surcharges applied to order totals

Returns:



173
# File 'lib/generated/gobl/bill/order.rb', line 173

property :charges, [GOBL::Bill::Charge]

#codeGOBL::CBC::Code (readonly)

Code is a sequential identifier that uniquely identifies the order. The code can be left empty initially, but is required to sign the document.

Returns:



82
# File 'lib/generated/gobl/bill/order.rb', line 82

property :code, GOBL::CBC::Code

#complementsArray<GOBL::Schema::Object> (readonly)

Additional complementary objects that add relevant information to the order.

Returns:



198
# File 'lib/generated/gobl/bill/order.rb', line 198

property :complements, [GOBL::Schema::Object]

#contractsArray<GOBL::Org::DocumentRef> (readonly)

The identification of contracts.

Returns:



117
# File 'lib/generated/gobl/bill/order.rb', line 117

property :contracts, [GOBL::Org::DocumentRef]

#currencyGOBL::Currency::Code (readonly)

Currency for all invoice totals.



107
# File 'lib/generated/gobl/bill/order.rb', line 107

property :currency, GOBL::Currency::Code

#customerGOBL::Org::Party (readonly)

Legal entity receiving the goods or services, may be nil in certain circumstances such as simplified invoices.

Returns:



148
# File 'lib/generated/gobl/bill/order.rb', line 148

property :customer, GOBL::Org::Party

#deliveryGOBL::Bill::DeliveryDetails (readonly)

Specific details on delivery of the goods to copy to the final invoice.



183
# File 'lib/generated/gobl/bill/order.rb', line 183

property :delivery, GOBL::Bill::DeliveryDetails

#discountsArray<GOBL::Bill::Discount> (readonly)

Discounts or allowances applied to order totals

Returns:



168
# File 'lib/generated/gobl/bill/order.rb', line 168

property :discounts, [GOBL::Bill::Discount]

#exchange_ratesArray<GOBL::Currency::ExchangeRate> (readonly)

Exchange rates to be used when converting the invoices monetary values into other currencies.

Returns:



112
# File 'lib/generated/gobl/bill/order.rb', line 112

property :exchange_rates, [GOBL::Currency::ExchangeRate]

#identitiesArray<GOBL::Org::Identity> (readonly)

Additional codes, IDs, SKUs, or other regional or custom identifiers that may be used to identify the order.

Returns:



127
# File 'lib/generated/gobl/bill/order.rb', line 127

property :identities, [GOBL::Org::Identity]

#issue_dateGOBL::Cal::Date (readonly)

When the invoice was created.

Returns:



87
# File 'lib/generated/gobl/bill/order.rb', line 87

property :issue_date, GOBL::Cal::Date

#issue_timeGOBL::Cal::Time (readonly)

IssueTime is an optional field that may be useful to indicate the time of day when the order was issued. Some regions and formats may require this field to be set. An empty string will be automatically updated to reflect the current time, otherwise the field can be left with a nil value.

Returns:



92
# File 'lib/generated/gobl/bill/order.rb', line 92

property :issue_time, GOBL::Cal::Time

#linesArray<GOBL::Bill::Line> (readonly)

List of lines representing each of the items to be ordered.

Returns:



163
# File 'lib/generated/gobl/bill/order.rb', line 163

property :lines, [GOBL::Bill::Line]

#metaGOBL::CBC::Meta (readonly)

Additional semi-structured data that doesn’t fit into the body of the order.

Returns:



203
# File 'lib/generated/gobl/bill/order.rb', line 203

property :meta, GOBL::CBC::Meta

#notesArray<GOBL::Org::Note> (readonly)

Unstructured information that is relevant to the order, such as correction or additional legal details.

Returns:



193
# File 'lib/generated/gobl/bill/order.rb', line 193

property :notes, [GOBL::Org::Note]

#op_dateGOBL::Cal::Date (readonly)

Date when the operation defined by the invoice became effective.

Returns:



97
# File 'lib/generated/gobl/bill/order.rb', line 97

property :op_date, GOBL::Cal::Date

#paymentGOBL::Bill::PaymentDetails (readonly)

Information on when, how, and to whom a final invoice would be paid.



178
# File 'lib/generated/gobl/bill/order.rb', line 178

property :payment, GOBL::Bill::PaymentDetails

#periodGOBL::Cal::Period (readonly)

Period of time in which the order is valid.

Returns:



132
# File 'lib/generated/gobl/bill/order.rb', line 132

property :period, GOBL::Cal::Period

#precedingArray<GOBL::Org::DocumentRef> (readonly)

Key information regarding previous order documents.

Returns:



122
# File 'lib/generated/gobl/bill/order.rb', line 122

property :preceding, [GOBL::Org::DocumentRef]

#sellerGOBL::Org::Party (readonly)

Seller is the party liable to pay taxes on the transaction if not the same as the supplier.

Returns:



158
# File 'lib/generated/gobl/bill/order.rb', line 158

property :seller, GOBL::Org::Party

#seriesGOBL::CBC::Code (readonly)

Series is used to identify groups of orders by date, business area, project, type, customer, a combination of any, or other company specific data. If the output format does not support the series as a separate field, it will be prepended to the code for presentation with a dash (‘-`) for separation.

Returns:



77
# File 'lib/generated/gobl/bill/order.rb', line 77

property :series, GOBL::CBC::Code

#supplierGOBL::Org::Party (readonly)

The entity supplying the goods or services and usually responsible for paying taxes.

Returns:



142
# File 'lib/generated/gobl/bill/order.rb', line 142

property :supplier, GOBL::Org::Party

#taxGOBL::Bill::Tax (readonly)

Special tax configuration for billing.

Returns:



137
# File 'lib/generated/gobl/bill/order.rb', line 137

property :tax, GOBL::Bill::Tax

#totalsGOBL::Bill::Totals (readonly)

Summary of all the order totals, including taxes (calculated).

Returns:



188
# File 'lib/generated/gobl/bill/order.rb', line 188

property :totals, GOBL::Bill::Totals

#typeGOBL::CBC::Key (readonly)

Type of the order.

Returns:



71
# File 'lib/generated/gobl/bill/order.rb', line 71

property :type, GOBL::CBC::Key

#uuidString (readonly)

Universally Unique Identifier.

Returns:

  • (String)


59
# File 'lib/generated/gobl/bill/order.rb', line 59

property :uuid, String

#value_dateGOBL::Cal::Date (readonly)

When the taxes of this invoice become accountable, if none set, the issue date is used.

Returns:



102
# File 'lib/generated/gobl/bill/order.rb', line 102

property :value_date, GOBL::Cal::Date